<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>第一个JSP程序</title>
        <script type="text/javascript" src="../jquery-1.8.3.js"></script>
        <script type="text/javascript">
            $(function() {
                var address;
                $.get("Area.xml",function(data) {
                    address = data;
                    init();
                },"xml");
                function init() {
                    $(address).find("province").each(function(n){
                        $("#province").append("<option value='"+$(this).attr("value")+"'>"+$(this).attr("name")+"</option>")
                    });
                    $("#province").change(function(event) {
                        $(address).find("province[value='"+$(this).val()+"'] city").each(function(n){
                            $("#city").append("<option value='"+$(this).attr("value")+"'>"+$(this).attr("name")+"</option>")
                        });
                    });
                    $("#city").change(function(event){
			            $(address).find("city[value='"+$(this).val()+"'] country").each(function(n){
            			    $("#country").append("<option value='"+$(this).attr("value")+"'>"+$(this).attr("name")+"</option>")
            			});
            		});
                };
            });
        </script>
    </head>
    <body>
        <select id="province"><option>请选择省份</option></select>
        <select id="city"><option>请选择城市</option></select>
        <select id="country"><option>请选择县份</option></select>

    </body>
</html>
